<template>
  <div>
    <MyHeader title="购物车" :style="{ backgroundColor: 'pink' }"></MyHeader>
    <div id="app">
      <MyGoods :obj="obj" v-for="obj in list" :key="obj.id"></MyGoods>
    </div>
    <MyFooter :arr="list"></MyFooter>
  </div>
</template>
<script>
import MyHeader from "./components/MyHeader";
import MyGoods from "./components/MyGoods";
import MyFooter from "./components/MyFooter";
export default {
  components: {
    MyHeader,
    MyGoods,
    MyFooter,
  },
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.$axios({
      url: "https://www.escook.cn/api/cart",
    }).then((res) => {
      return (this.list = res.data.list);
    });
  },
};
</script>

<style>
#app {
  padding-top: 45px;
  padding-bottom: 50px;
}
</style>